<!DOCTYPE html>
<html lang="en">
<head>

    <!--
      Obviously, used Bootstrap Web site as template.
      Tried to write from scratch but it still looked like bootstrap site, but wasn't that good.
    -->

    <meta charset="utf-8">
    <title>Midao Project</title>
    <meta property="og:title" content="Midao - data oriented umbrella project"/>
    <meta property="og:description"
          content="Midao Project is created to shield Java developer from nuances of vendor implementation and standard boilerplate code.
            Midao JDBC simplifies development with Java JDBC. It is flexible, customizable, and simple/intuitive to use, and provides a lot of functionality"/>
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="description" content="">
    <meta name="author" content="">

    <!-- Le styles -->
    <link href="css/bootstrap.css" rel="stylesheet">
    <link href="css/bootstrap-responsive.css" rel="stylesheet">
    <link href="css/docs.css" rel="stylesheet">
    <link href="js/google-code-prettify/prettify.css" rel="stylesheet">

    <!-- Le HTML5 shim, for IE6-8 support of HTML5 elements -->
    <!--[if lt IE 9]>
    <script src="js/html5shiv.js"></script>
    <![endif]-->

    <!-- Le fav and touch icons -->
    <link rel="apple-touch-icon-precomposed" sizes="144x144" href="ico/apple-touch-icon-144-precomposed.png">
    <link rel="apple-touch-icon-precomposed" sizes="114x114" href="ico/apple-touch-icon-114-precomposed.png">
    <link rel="apple-touch-icon-precomposed" sizes="72x72" href="ico/apple-touch-icon-72-precomposed.png">
    <link rel="apple-touch-icon-precomposed" href="ico/apple-touch-icon-57-precomposed.png">
    <link rel="shortcut icon" href="ico/favicon.png">

</head>

<body data-spy="scroll" data-target=".bs-docs-sidebar">

<!-- Navbar
================================================== -->
<div class="navbar navbar-inverse navbar-fixed-top">
    <div class="navbar-inner">
        <div class="container">
            <button type="button" class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
            </button>

            <div class="nav-collapse collapse">
                <ul class="nav pull-left">
                    <li>
                        <a class="brand">Midao Project <i class="icon-chevron-right icon-white caret-chevron-c"></i></a>
                    </li>

                    <li class="active">
                        <a href="./home.html">Home</a>
                    </li>
                    <li class="">
                        <a href="./news">Blog / news</a>
                    </li>
                    <li class="">
                        <a href="./status.html">Status / future</a>
                    </li>
                    <li class="">
                        <a href="./get-involved.html">Get Involved</a>
                    </li>

                    <li class="dropdown">
                        <a href="" class="brand" data-toggle="dropdown">Midao JDBC <i class="icon-chevron-down icon-white caret-chevron-c"></i></a>
                        <ul class="dropdown-menu pull-right">
                            <li class="">
                                <a href="./mjdbc-query.html">Query Execution</a>
                            </li>
                            <li class="">
                                <a href="./mjdbc-io-handlers.html">IO Handlers</a>
                            </li>
                            <li class="">
                                <a href="./mjdbc-core-handlers.html">Core Handlers</a>
                            </li>
                            <li class="">
                                <a href="./mjdbc-other-features.html">Other features</a>
                            </li>
                        </ul>
                    </li>

                </ul>
                <ul class="nav pull-right">
                    <li class="dropdown">
                        <a href="" class="brand" data-toggle="dropdown">Midao Docs <i class="icon-chevron-down icon-white caret-chevron-c"></i></a>
                        <ul class="dropdown-menu pull-right">
                            <li class="">
                                <a href="./mjdbc-presentation.html">Midao JDBC Presentation</a>
                            </li>
                            <li class="">
                                <a href="./mjdbc-getting-started.html">Midao JDBC Getting Started</a>
                            </li>
                        </ul>
                    </li>
                </ul>
            </div>
        </div>
    </div>
</div>

<!-- Subhead
================================================== -->
<header class="jumbotron subhead" id="overview">
    <div class="container">
        <h1>Getting started</h1>

        <p class="lead">Overview of the project and how to start using it</p>
    </div>
</header>

<div class="container">

    <!-- Docs nav
    ================================================== -->
    <div class="row">
        <div class="span3 bs-docs-sidebar">
            <ul class="nav nav-list bs-docs-sidenav">
                <li><a href="#about"><i class="icon-chevron-right"></i> About</a></li>
                <li><a href="#why"><i class="icon-chevron-right"></i> Why ?</a></li>
                <li><a href="#start-using"><i class="icon-chevron-right"></i> Start using</a></li>
                <li><a href="#project-structure"><i class="icon-chevron-right"></i> Project structure / dependencies</a></li>
                <li><a href="#contents"><i class="icon-chevron-right"></i> What's included</a></li>
                <li><a href="#examples"><i class="icon-chevron-right"></i> Examples</a></li>
                <li><a href="#what-next"><i class="icon-chevron-right"></i> What next?</a></li>
            </ul>
        </div>
        <div class="span9">

            <!-- About
            ================================================== -->
            <section id="about">
                <div class="page-header">
                    <h1>1. About</h1>
                </div>
                <p class="lead">Goal of this data centric project - is to shield Java developer from nuances of vendor implementation and standard boilerplate code.</p>

                <p class="lead">Midao Project have first library released: <strong>Midao JDBC</strong>. The rest is under development and will be released when ready.</p>

                <hr class="bs-docs-separator">
                <div class="accordion" id="mjdbc-accordion">

                    <div class="accordion-group">
                        <div class="accordion-heading accordion-heading-gray-c">
                            <a class="accordion-toggle text-center" data-toggle="collapse" data-parent="#mjdbc-accordion" href="#mjdbc-desc">
                                <strong style="font-size:22px;line-height:35px;">Midao JDBC</strong>
                            </a>
                        </div>
                        <div id="mjdbc-desc" class="accordion-body">
                            <div class="accordion-inner">

                                <p class="lead">Midao JDBC is created to simplify development with Java JDBC.</p>

                                <p class="lead">It is flexible, customizable, simple/intuitive to use and provides a lot of functionality: <a href="mjdbc-core-handlers.html#transaction-handler">transactions</a>, <a href="mjdbc-core-handlers.html#metadata-handler">work with metadata</a>,
                                    <a href="mjdbc-core-handlers.html#type-handler">type handling</a>, <a href="mjdbc-other-features.html#profiler">profiling</a>, <a href="mjdbc-io-handlers.html">input/output/xml processing/converting</a>,
                                    <a href="mjdbc-other-features.html#pooled-datasource">pooled datasource libraries support</a>,
                                    <a href="mjdbc-io-handlers.html">cached</a>/<a href="mjdbc-other-features.html#lazy">lazy</a><a href="mjdbc-other-features.html#lazy-scroll-update">(scrollable/updateable)</a> query execution, <a href="home.html#examples">named parameters</a>,
                                    <a href="mjdbc-other-features.html#vendor">multiple vendor support out of the box</a>, <a href="mjdbc-core-handlers.html#exception-handler">custom exception handling</a> and <a href="mjdbc-query.html#query-overrider">overrides</a>.</p>

                                <p class="lead">With single jar it supports both JDBC 3.0(Java 5) and JDBC 4.0(Java 6).</p>

                                <p class="lead">Midao JDBC is well tested, not only it has over 900 unit and functional tests, but also it is tested with latest drivers of: Derby, MySQL (MariaDB), PostgreSQL, Microsoft SQL and Oracle.</p>

                            </div>
                        </div>
                    </div>

                </div>

            </section>

            <!-- Why
            ================================================== -->
            <section id="why">
                <div class="page-header">
                    <h1>2. Why ?</h1>
                </div>
                <p class="lead">There are a lot of Open-Source Java Projects out there. This section created to help you decide if this project is something which might be useful for you.</p>

                <div class="accordion" id="mjdb-whyc-accordion">

                    <div class="accordion-group">
                        <div class="accordion-heading accordion-heading-gray-c">
                            <a class="accordion-toggle text-center" data-toggle="collapse" data-parent="#mjdbc-why-accordion" href="#mjdbc-why-desc">
                                <strong style="font-size:22px;line-height:35px;">Midao JDBC</strong>
                            </a>
                        </div>
                        <div id="mjdbc-why-desc" class="accordion-body">
                            <div class="accordion-inner">

                                <p class="lead"><strong>Unlike standard JDBC libraries</strong> - it allows usage of classes/maps, custom error handling, transaction handling, type conversion, cached and lazy queries, stored procedure handling and pooled connections.</p>

                                <p class="lead"><strong>Unlike ORM frameworks</strong> - it doesn't hide SQL from you, while allowing you to use classes/maps to set and read values from Databases. Class/map mapping also is allowed for stored procedures.</p>

                                <p class="lead"><strong>Customization and Simplicity</strong> - library tries to provide simplicity of DbUtils while providing functionality/customization of Spring JDBC and often going beyond that.</p>

                                <p class="lead"><strong>Pluggable architecture</strong> - allows to plug-in any suitable pooled datasource. Provides custom handlers tailored to specific DB Vendor. Provides some Spring JDBC handlers to make usage/migration from Spring JDBC easier/comfortable.</p>

                                <p class="lead"><strong>Versatile</strong> - with single jar supports both JDBC 3.0(Java 5) and JDBC 4.0(Java 6).</p>

                                <p class="lead"><strong>Well tested</strong> - not only it has around 800 unit and functional tests, but also it is tested with latest drivers of: Derby, MySQL (MariaDB), PostgreSQL, Microsoft SQL and Oracle.</p>

                                <div class="accordion" id="mjdbc-why-not-accordion">

                                    <div class="accordion-group">
                                        <div class="accordion-heading accordion-heading-gray-c">
                                            <a class="accordion-toggle text-center" data-toggle="collapse" data-parent="#mjdbc-why-not-accordion" href="#mjdbc-spring-jdbc-desc">
                                                <strong style="font-size:22px;line-height:35px;">vs Spring JDBC</strong>
                                            </a>
                                        </div>
                                        <div id="mjdbc-spring-jdbc-desc" class="accordion-body collapse">
                                            <div class="accordion-inner">
                                                <ul>
                                                    <li>Smaller and simpler.</li>
                                                    <li>No dependency on Spring Container.</li>
                                                    <li>Provides functionality which is absent in Spring JDBC.</li>
                                                    <li>Provides some support for Spring JDBC (templates, exception handlers, metadata handlers).</li>
                                                    <li>Exposes a lot of configuration/extension opportunities without the need to actually modify library code.</li>
                                                </ul>
                                                <p class="muted">Please be aware that above points would be elaborated in Migration Guide planned to be released in
                                                    <del>
                                                        <small>August-September</small>
                                                    </del>
                                                    Autumn 2013.
                                                </p>
                                            </div>
                                        </div>
                                    </div>

                                    <div class="accordion-group">
                                        <div class="accordion-heading accordion-heading-gray-c">
                                            <a class="accordion-toggle text-center" data-toggle="collapse" data-parent="#mjdbc-why-not-accordion" href="#mjdbc-apache-dbutils-desc">
                                                <strong style="font-size:22px;line-height:35px;">vs Apache DbUtils</strong>
                                            </a>
                                        </div>
                                        <div id="mjdbc-apache-dbutils-desc" class="accordion-body collapse">
                                            <div class="accordion-inner">
                                                <ul>
                                                    <li>Handles much more of JDBC boilerplate code.</li>
                                                    <li>Provides significantly more functionality.</li>
                                                    <li>Configurable/Extensible.</li>
                                                    <li>Midao JDBC follows principles set by DbUtils. Which results in easy migration and short learning curve for Apache DbUtils projects.</li>
                                                </ul>
                                                <p class="muted">Please be aware that above points would be elaborated in Migration Guide planned to be released in
                                                    <del>
                                                        <small>August-September</small>
                                                    </del>
                                                    Autumn 2013.
                                                </p>
                                            </div>
                                        </div>
                                    </div>

                                    <div class="accordion-group">
                                        <div class="accordion-heading accordion-heading-gray-c">
                                            <a class="accordion-toggle text-center" data-toggle="collapse" data-parent="#mjdbc-why-not-accordion" href="#mjdbc-orm-desc">
                                                <strong style="font-size:22px;line-height:35px;">vs ORM Libraries(JPA/Hibernate etc.)</strong>
                                            </a>
                                        </div>
                                        <div id="mjdbc-orm-desc" class="accordion-body collapse">
                                            <div class="accordion-inner">
                                                <ul>
                                                    <li>Smaller and have better performance(because of direct JDBC usage).</li>
                                                    <li>Midao JDBC is not an ORM Library/Framework nor tries to be one. It's main goal to work with SQL directly while providing functionality to make it more comfortable to use object relational mapping when needed.</li>
                                                </ul>
                                            </div>
                                        </div>
                                    </div>

                                </div>
                            </div>
                        </div>
                    </div>
                </div>

            </section>

            <!-- Start using
            ================================================== -->
            <section id="start-using">
                <div class="page-header">
                    <h1>3. Start using</h1>
                </div>

                <div class="accordion" id="mjdbc-start-using-accordion">

                    <div class="accordion-group">
                        <div class="accordion-heading accordion-heading-gray-c">
                            <a class="accordion-toggle text-center" data-toggle="collapse" data-parent="#mjdbc-start-using-accordion" href="#mjdbc-download">
                                <strong style="font-size:22px;line-height:35px;">Midao JDBC</strong>
                            </a>
                        </div>
                        <div id="mjdbc-download" class="accordion-body">
                            <div class="accordion-inner">

                                <p class="lead">Get to know project and library, browse getting started guide.</p>

                                <div class="row-fluid">
                                    <div class="span6">
                                        <h2>Download presentation</h2>

                                        <p>Get to know project in general and library in particular</p>

                                        <p>
                                            <a class="btn btn-large" href="mjdbc/MJDBC_Presentation.pdf">Download presentation</a>
                                        </p>
                                    </div>
                                    <div class="span6">
                                        <h2>Getting started</h2>

                                        <p>Get more help on how to start using this library</p>

                                        <p>
                                            <a class="btn btn-large btn-primary" href="mjdbc-getting-started.html">Getting started guide</a>
                                        </p>
                                    </div>
                                </div>

                                <hr class="bs-docs-separator">

                                <p class="lead">You can start using it via adding as a dependency in Maven pom.xml or by downloading jar and adding it to project classpath</p>

                                <h2>Maven</h2>
						<pre class="linenums">
pom.xml:

..
&ltdependency&gt
  &ltgroupId&gtorg.midao&lt/groupId&gt
  &ltartifactId&gtmidao-jdbc-core&lt/artifactId&gt
  &ltversion&gt0.9.5&lt/version&gt
&lt/dependency&gt 
..</pre>

                                <div class="row-fluid">
                                    <div class="span6">
                                        <h2>Download</h2>

                                        <p><strong>Fastest way to get started:</strong> get the compiled version (JavaDoc and Sources download available via dropdown menu).</p>

                                        <p>

                                        <div class="btn-group">
                                            <a class="btn btn-large btn-primary" href="mjdbc/midao-jdbc-core-0.9.5.jar">Download Midao JDBC</a>
                                            <button class="btn btn-large btn-primary dropdown-toggle" data-toggle="dropdown">
                                                <span class="caret"></span>
                                            </button>
                                            <ul class="dropdown-menu">
                                                <li><a href="mjdbc/midao-jdbc-core-0.9.5-javadoc.jar">Download JavaDoc</a></li>
                                                <li><a href="mjdbc/midao-jdbc-core-0.9.5-sources.jar">Download Sources</a></li>
                                                <li class="dropdown-submenu">
                                                    <a tabindex="-1" href="#">Previous versions</a>
                                                    <ul class="dropdown-menu">
                                                        <li class="dropdown-submenu">
                                                            <a tabindex="-1" href="#">Midao JDBC 0.9.4</a>
                                                            <ul class="dropdown-menu">
                                                                <li><a href="mjdbc/midao-jdbc-core-0.9.4.jar">Download 0.9.4 Core</a></li>
                                                                <li><a href="mjdbc/midao-jdbc-core-0.9.4-javadoc.jar">Download 0.9.4 JavaDoc</a></li>
                                                                <li><a href="mjdbc/midao-jdbc-core-0.9.4-sources.jar">Download 0.9.4 Sources</a></li>
                                                            </ul>
                                                        </li>
                                                        <li class="dropdown-submenu">
                                                            <a tabindex="-1" href="#">Midao JDBC 0.9.3</a>
                                                            <ul class="dropdown-menu">
                                                                <li><a href="mjdbc/midao-jdbc-core-0.9.3.jar">Download 0.9.3 Core</a></li>
                                                                <li><a href="mjdbc/midao-jdbc-core-0.9.3-javadoc.jar">Download 0.9.3 JavaDoc</a></li>
                                                                <li><a href="mjdbc/midao-jdbc-core-0.9.3-sources.jar">Download 0.9.3 Sources</a></li>
                                                            </ul>
                                                        </li>
                                                        <li class="dropdown-submenu">
                                                            <a tabindex="-1" href="#">Midao JDBC 0.9.2</a>
                                                            <ul class="dropdown-menu">
                                                                <li><a href="mjdbc/midao-jdbc-core-0.9.2.jar">Download 0.9.2 Core</a></li>
                                                                <li><a href="mjdbc/midao-jdbc-core-0.9.2-javadoc.jar">Download 0.9.2 JavaDoc</a></li>
                                                                <li><a href="mjdbc/midao-jdbc-core-0.9.2-sources.jar">Download 0.9.2 Sources</a></li>
                                                            </ul>
                                                        </li>
                                                        <li class="dropdown-submenu">
                                                            <a tabindex="-1" href="#">Midao JDBC 0.9.1</a>
                                                            <ul class="dropdown-menu">
                                                                <li><a href="mjdbc/midao-jdbc-core-0.9.1.jar">Download 0.9.1 Core</a></li>
                                                                <li><a href="mjdbc/midao-jdbc-core-0.9.1-javadoc.jar">Download 0.9.1 JavaDoc</a></li>
                                                                <li><a href="mjdbc/midao-jdbc-core-0.9.1-sources.jar">Download 0.9.1 Sources</a></li>
                                                            </ul>
                                                        </li>
                                                        <li class="dropdown-submenu">
                                                            <a tabindex="-1" href="#">Midao (JDBC) 0.9.1</a>
                                                            <ul class="dropdown-menu">
                                                                <li><a href="mjdbc/midao-core-0.9.1.jar">Download 0.9.1 Core</a></li>
                                                                <li><a href="mjdbc/midao-core-0.9.1-javadoc.jar">Download 0.9.1 JavaDoc</a></li>
                                                                <li><a href="mjdbc/midao-core-0.9.1-sources.jar">Download 0.9.1 Sources</a></li>
                                                            </ul>
                                                        </li>
                                                        <li class="dropdown-submenu">
                                                            <a tabindex="-1" href="#">Midao (JDBC) 0.9.0</a>
                                                            <ul class="dropdown-menu">
                                                                <li><a href="mjdbc/midao-core-0.9.0.jar">Download 0.9.0 Core</a></li>
                                                                <li><a href="mjdbc/midao-core-0.9.0-javadoc.jar">Download 0.9.0 JavaDoc</a></li>
                                                                <li><a href="mjdbc/midao-core-0.9.0-sources.jar">Download 0.9.0 Sources</a></li>
                                                            </ul>
                                                        </li>
                                                    </ul>
                                                </li>
                                            </ul>
                                        </div>
                                        </p>
                                    </div>
                                    <div class="span6">
                                        <h2>Browse source</h2>

                                        <p>Browse latest source code, raise issues, fork and possibly improve directly via GitHub</p>

                                        <p><a class="btn btn-large" target="_blank" href="https://github.com/pryzach/midao">Browse source code on GitHub</a></p>
                                    </div>
                                </div>

                            </div>
                        </div>
                    </div>
                </div>
            </section>


            <!-- Project structure / dependencies
            ================================================== -->
            <section id="project-structure">
                <div class="page-header">
                    <h1>4. Project structure / dependencies</h1>
                </div>
                <div class="accordion" id="mjdbc-structure-accordion">

                    <div class="accordion-group">
                        <div class="accordion-heading accordion-heading-gray-c">
                            <a class="accordion-toggle text-center" data-toggle="collapse" data-parent="#mjdbc-structure-accordion" href="#mjdbc-structure">
                                <strong style="font-size:22px;line-height:35px;">Midao JDBC</strong>
                            </a>
                        </div>
                        <div id="mjdbc-structure" class="accordion-body">
                            <div class="accordion-inner">

                                <h3>3.1 Project structure</h3>
		  
						<pre class="prettyprint">
  <a href="mjdbc-query.html">QueryRunner</a>
  |
  +-- <a href="mjdbc-query.html#query-overrider">Overrider</a>
  |
  +-- <a href="mjdbc-core-handlers.html#statement-handler">StatementHandler</a>
  |
  +-- <a href="mjdbc-core-handlers.html#metadata-handler">MetadataHandler</a>
  |
  +-- <a href="mjdbc-core-handlers.html#type-handler">TypeHandler</a>
  |
  +-- <a href="mjdbc-core-handlers.html#transaction-handler">TransactionHandler</a>
  |
  +-- <a href="mjdbc-core-handlers.html#exception-handler">ExceptionHandler</a>
  
  <a href="mjdbc-other-features.html#processor">Processor</a>
  |
  +-- <a href="mjdbc-other-features.html#processor">QueryInputProcessor</a>
  |
  +-- <a href="mjdbc-other-features.html#processor">QueryOutputProcessor</a>
  
  <a href="mjdbc-other-features.html#profiler">Profiler</a>
  
  <a href="mjdbc-other-features.html#pooled-datasource">PooledDataSource</a>

  <a href="mjdbc-io-handlers.html#input-handler">InputHandler</a>

  <a href="mjdbc-io-handlers.html#output-handler">OutputHandler</a>

  <a href="mjdbc-io-handlers.html#xml-handler">XmlHandler</a>

</pre>

                                </br>
                                <h3>4.2 Dependencies</h3>

                                <p class="lead">Midao does not have any mandatory dependencies</p>

                                <p>By default Midao uses Java Logging to perform logging.</p>
                                </br>

                                <p>If <a href="http://www.slf4j.org/">SLF4j</a> would be found in Classpath - it would be automatically picked by Midao instead of Java Logging.</p>

                                <p>SLF4j is "abstract" logging library which allows to plug-in different Logging libraries.</p>

                                <p>In short that means if your project uses log4j(or any other) - it will automatically(if proper slf4j dependency added) pick it up and will use it along with existing configuration.</p>
		  
           <pre class="">
pom.xml (Maven)
..
<-- this dependency is mandatory  -->
&ltdependency&gt
	&ltgroupId&gtorg.slf4j&lt/groupId&gt
	&ltartifactId&gtslf4j-api&lt/artifactId&gt
	&ltversion&gt1.6.6&lt/version&gt
&lt/dependency&gt

<-- add next dependency if you want to use Java Logging via slf4j  -->
&ltdependency&gt
	&ltgroupId&gtorg.slf4j&lt/groupId&gt
	&ltartifactId&gtslf4j-jdk14&lt/artifactId&gt
	&ltversion&gt1.6.6&lt/version&gt
&lt/dependency&gt

<-- or this if you want to use log4j via slf4j  -->
&ltdependency&gt
	&ltgroupId&gtorg.slf4j&lt/groupId&gt
	&ltartifactId&gtslf4j-log4j12&lt/artifactId&gt
	&ltversion&gt1.6.6&lt/version&gt
&lt/dependency&gt
..</pre>
                            </div>
                        </div>
                    </div>
                </div>
            </section>


            <!-- Contents
            ================================================== -->
            <section id="contents">
                <div class="page-header">
                    <h1>5. What's included</h1>
                </div>

                <div class="accordion" id="mjdbc-components-accordion">

                    <div class="accordion-group">
                        <div class="accordion-heading accordion-heading-gray-c">
                            <a class="accordion-toggle text-center" data-toggle="collapse" data-parent="#mjdbc-components-accordion" href="#mjdbc-components">
                                <strong style="font-size:22px;line-height:35px;">Midao JDBC</strong>
                            </a>
                        </div>
                        <div id="mjdbc-components" class="accordion-body">
                            <div class="accordion-inner">

                                <p class="lead">For detailed information and description of supplied components - please look at <a href="http://midao.org/mjdbc/javadoc/index.html">JavaDoc</a>.</p>

                                <h2>List of components</h2>

                                <p><i>Below you will find "logical" components present in Midao</i></p>
                                <ul>
                                    <li><a href="mjdbc-query.html#query-runner">QueryRunnerService</a></li>
                                    <li><a href="mjdbc-query.html#async-query-runner">AsyncQueryRunnerService</a></li>
                                    <li><a href="mjdbc-query.html#query-overrider">Overrider</a></li>
                                    <li><a href="mjdbc-core-handlers.html#statement-handler">StatementHandler</a>
                                        <ul>
                                            <li>BaseStatementHandler</li>
                                            <li>CallableStatementHandler</li>
                                        </ul>
                                    </li>
                                    <li><a href="mjdbc-core-handlers.html#metadata-handler">MetadataHandler</a>
                                        <ul>
                                            <li>BaseMetadataHandler</li>
                                        </ul>
                                    </li>
                                    <li><a href="mjdbc-core-handlers.html#type-handler">TypeHandler</a>
                                        <ul>
                                            <li>EmptyTypeHandler</li>
                                            <li>BaseTypeHandler</li>
                                            <li>UniversalTypeHandler</li>
                                            <li>OracleTypeHandler</li>
                                        </ul>
                                    </li>
                                    <li><a href="mjdbc-core-handlers.html#transaction-handler">TransactionHandler</a>
                                        <ul>
                                            <li>BaseTransactionHandler</li>
                                        </ul>
                                    </li>
                                    <li><a href="mjdbc-core-handlers.html#exception-handler">ExceptionHandler</a>
                                        <ul>
                                            BaseExceptionHandler
                                        </ul>
                                    </li>
                                    <li><a href="mjdbc-other-features.html#processor">Processor</a>
                                        <ul>
                                            <li>QueryInputProcessor
                                                <ul>
                                                    <li>BaseQueryInputProcessor</li>
                                                    <li>ExtendedQueryInputProcessor</li>
                                                    <li>SpringQueryInputProcessor</li>
                                                </ul>
                                            </li>
                                            <li>QueryOutputProcessor
                                                <ul>
                                                    <li>BaseQueryOutputProcessor</li>
                                                </ul>
                                            </li>
                                        </ul>
                                    </li>
                                    <li><a href="mjdbc-other-features.html#profiler">Profiler</a></li>
                                    <li><a href="mjdbc-other-features.html#pooled-datasource">PooledDataSource</a></li>
                                    <li><a href="mjdbc-io-handlers.html#input-handler">InputHandler</a>
                                        <ul>
                                            <li><a href="mjdbc-io-handlers.html#named-input-handler">NamedInputHandler</a>
                                                <ul>
                                                    <li>BeanInputHandler
                                                        <ul>
                                                            <li>BeanInputHandlerEx</li>
                                                            <li>SpringBeanInputHandler</li>
                                                        </ul>
                                                    </li>
                                                    <li>BeanListInputHandler
                                                        <ul>
                                                            <li>BeanListInputHandlerEx</li>
                                                            <li>SpringBeanListInputHandler</li>
                                                        </ul>
                                                    </li>
                                                    <li>MapInputHandler
                                                        <ul>
                                                            <li>MapInputHandlerEx</li>
                                                            <li>SpringMapInputHandler</li>
                                                        </ul>
                                                    </li>
                                                    <li>MapListInputHandler
                                                        <ul>
                                                            <li>MapListInputHandlerEx</li>
                                                            <li>SpringMapListInputHandler</li>
                                                        </ul>
                                                    </li>
                                                </ul>
                                            </li>
                                            <li><a href="mjdbc-io-handlers.html#query-input-handler">QueryInputHandler</a>
                                                <ul>
                                                    <li>QueryInputHandler</li>
                                                </ul>
                                            </li>
                                        </ul>
                                    </li>
                                    <li><a href="mjdbc-io-handlers.html#output-handler">OutputHandler</a>
                                        <ul>
                                            <li><a href="mjdbc-io-handlers.html#keyed-output-handler">KeyedOutputHandler</a>
                                                <ul>
                                                    <li>BeanMapOutputHandler</li>
                                                    <li>KeyedOutputHandler</li>
                                                </ul>
                                            </li>
                                            <li><a href="mjdbc-io-handlers.html#base-output-handler">BaseOutputHandler</a>
                                                <ul>
                                                    <li>ArrayListOutputHandler</li>
                                                    <li>ArrayOutputHandler</li>
                                                    <li>BeanListOutputHandler</li>
                                                    <li>BeanOutputHandler</li>
                                                    <li>ColumnListOutputHandler</li>
                                                    <li>MapListOutputHandler</li>
                                                    <li>MapOutputHandler</li>
                                                    <li>RowCountOutputHandler</li>
                                                    <li>ScalarOutputHandler</li>
                                                </ul>
                                            </li>
                                            <li><a href="mjdbc-io-handlers.html#lazy-output-handler">LazyOutputHandler</a>
                                                <ul>
                                                    <li>MapLazyOutputHandler</li>
                                                    <li>MapLazyScrollOutputHandler</li>
                                                    <li>MapLazyUpdateOutputHandler</li>
                                                    <li>MapLazyScrollUpdateOutputHandler</li>
                                                    <li>BeanLazyOutputHandler</li>
                                                    <li>BeanLazyScrollOutputHandler</li>
                                                    <li>BeanLazyUpdateOutputHandler</li>
                                                    <li>BeanLazyScrollUpdateOutputHandler</li>
                                                </ul>
                                            </li>
                                        </ul>
                                    </li>
                                    <li><a href="mjdbc-io-handlers.html#xml-handler">XmlHandler</a>
                                        <ul>
                                            <li>XmlInputOutputHandler</li>
                                        </ul>
                                    </li>
                                </ul>
                                <p>In future guides, we may walk through these components individually in more detail. Until then, look for each of these in the documentation for information on how to utilize and customize them.</p>
                            </div>
                        </div>
                    </div>
                </div>
            </section>


            <!-- Examples
            ================================================== -->
            <section id="examples">
                <div class="page-header">
                    <h1>6. Examples</h1>
                </div>

                <div class="accordion" id="mjdbc-examples-accordion">

                    <div class="accordion-group">
                        <div class="accordion-heading accordion-heading-gray-c">
                            <a class="accordion-toggle text-center" data-toggle="collapse" data-parent="#mjdbc-examples-accordion" href="#mjdbc-examples">
                                <strong style="font-size:22px;line-height:35px;">Midao JDBC</strong>
                            </a>
                        </div>
                        <div id="mjdbc-examples" class="accordion-body">
                            <div class="accordion-inner">

                                <p class="lead">For more examples and Database specific handling please look at examples present in <a href="https://github.com/pryzach/midao/tree/master/midao-jdbc-examples/src/main/java/org/midao/jdbc/examples">GitHub</a></p>

                                <div class="bs-docs-example">
                                    Example of simple query
                                </div>
<pre class="prettyprint linenums">
QueryRunnerService runner = MjdbcFactory.getQueryRunner(this.dataSource);

Map&ltString, Object&gt queryParameters = new HashMap&ltString, Object&gt();
queryParameters.put("id", 1);

MapInputHandler input = new MapInputHandler("SELECT name FROM students WHERE id = :id", queryParameters);

Map&ltString, Object&gt result = runner.query(input, new MapOutputHandler());

// result keeps all returned columns as map
</pre>

                                <div class="bs-docs-example">
                                    Example of lazy query
                                </div>
<pre class="prettyprint linenums">
// It is generally advised to use standard cached quesries as all resource management is done by the system.

// During lazy query execution developer have to manually manage transactions (QueryRunnerService.commit/rollback) and manually close resources (LazyOutputHandler.close).
QueryRunnerService runner = MjdbcFactory.getQueryRunner(this.dataSource);

// lazy query execution can be done only in manual transaction mode.
runner.setTransactionManualMode(true);

MapInputHandler input = new MapInputHandler("SELECT * FROM students", null);

// return as Map List
MapLazyOutputHandler lazyMapList =  runner.query(input, new MapLazyOutputHandler());

// return as Bean List
BeanLazyOutputHandler&ltStudent&gt lazyBeanList = runner.query(input, new BeanLazyOutputHandler&ltStudent&gt(Student.class));

// iterate over Map List
while (lazyMapList.hasNext() == true) {
	// retrieve next element
	lazyMapList.getNext() // returns Map
}

// freeing all used resources. If not closed - might lead to resource leak and/or errors.
lazyMapList.close();

// iterate over Bean List
while (lazyBeanList.hasNext() == true) {
	// retrieve next element
	lazyBeanList.getNext() // returns Student class
}

// freeing all used resources. If not closed - might lead to resource leak and/or errors.
lazyBeanList.close();

// telling to finish current transaction(doesn't matter if it is update or just query) and free all the resources.
// if current transaction would be committed before LazyOutputHandler was closed - it might be no longer accessible.
runner.commit();
</pre>

                                <div class="bs-docs-example">
                                    Example retrieval of generated keys
                                </div>
<pre class="prettyprint linenums">
String INSERT_STUDENT_TABLE = "INSERT INTO students (name, address) VALUES ('Not me', 'unknown')";

QueryRunnerService runner = MjdbcFactory.getQueryRunner(this.dataSource);

MapOutputHandler handler = new MapOutputHandler();

// in this example ID is generated field

// works for MySQL, MariaDB, PostgreSQL and others
Map&ltString, Object&gt result = runner.update(INSERT_STUDENT_TABLE, handler, new Object[0])

// works for Oracle
Map&ltString, Object&gt result =  runner.overrideOnce(MjdbcConstants.OVERRIDE_GENERATED_COLUMN_NAMES, new String [] {"ID"}).update(INSERT_STUDENT_TABLE, handler, new Object[0])

// result keeps all generated keys
</pre>

                                <div class="bs-docs-example">
                                    Example handling of Large types
                                </div>
<pre class="prettyprint linenums">
// for MySQL, MariaDB, PostgreSQL etc.
QueryRunnerService runner = MjdbcFactory.getQueryRunner(this.dataSource, UniversalTypeHandler.class);

// for Oracle
QueryRunnerService runner = MjdbcFactory.getQueryRunner(this.dataSource, OracleTypeHandler.class);

QueryInputHandler input = null;
QueryParameters parameters = new QueryParameters();

// for MySQL, MariaDB, Oracle
parameters.set("clobIn", "John", Types.CLOB, QueryParameters.Direction.IN);
parameters.set("clobOut", null, Types.CLOB, QueryParameters.Direction.OUT);
		        
parameters.set("blobIn", "Doe", Types.BLOB, QueryParameters.Direction.IN);
parameters.set("blobOut", null, Types.BLOB, QueryParameters.Direction.OUT);

// for PostgreSQL
parameters.set("clobIn", "John", Types.VARCHAR, QueryParameters.Direction.IN);
parameters.set("clobOut", null, Types.VARCHAR, QueryParameters.Direction.OUT);
		        
parameters.set("blobIn", "Doe".getBytes(), Types.BINARY, QueryParameters.Direction.IN);
parameters.set("blobOut", null, Types.BINARY, QueryParameters.Direction.OUT);

input = new QueryInputHandler("{call TEST_PROC_LARGE(:clobIn, :clobOut, :blobIn, :blobOut)}", parameters);

CallResults&ltQueryParameters, Map&ltString, Object&gt&gt result = this.values.put("result", runner.call(input, new MapOutputHandler()));

// result.getCallInput() - you will get updated input from OUT/INOUT parameters
// result.getCallOutput() - you will get Procedure/Function return
</pre>

                                <div class="bs-docs-example">
                                    Example ORM capabilities
                                </div>
<pre class="prettyprint linenums">
QueryRunnerService runner = MjdbcFactory.getQueryRunner(this.dataSource);

BeanInputHandler&ltStudent&gt input = null;
Student student = new Student();
student.setId(2);

// :id is IN parameter and :name and :address are OUT parameters
input = new BeanInputHandler&ltStudent&gt("{call TEST_NAMED(:id, :name, :address)}", student);

// result would be filled student object searched by ID = 2. All values would come from OUT parameters
Student result = runner.call(input);
</pre>

                                <div class="bs-docs-example">
                                    Example handling of Return/Cursor
                                </div>
<pre class="prettyprint linenums">
// for MySQL, MariaDB, PostgreSQL etc.
QueryRunnerService runner = MjdbcFactory.getQueryRunner(this.dataSource, UniversalTypeHandler.class);

// for Oracle
QueryRunnerService runner = MjdbcFactory.getQueryRunner(this.dataSource, OracleTypeHandler.class);

QueryInputHandler input = null;
QueryParameters parameters = new QueryParameters();

// for Oracle
parameters.set("cursor", null, oracle.jdbc.OracleTypes.CURSOR, QueryParameters.Direction.OUT);
parameters.set("id", 2, Types.INTEGER, QueryParameters.Direction.IN);

input = new QueryInputHandler("{CALL :cursor := TEST_PROC_RETURN(:id)}", parameters);

// for MySQL, MariaDB, PostgreSQL etc.
parameters.set("id", 2, Types.INTEGER, QueryParameters.Direction.IN);

// Postgres has a little different invocation style
input = new QueryInputHandler("{:cursor = call TEST_PROC_RETURN(:id)}", parameters);

// MySQL, MariaDB etc.
input = new QueryInputHandler("{call TEST_PROC_RETURN(:id)}", parameters);

CallResults&ltQueryParameters, Map&ltString, Object&gt&gt result = runner.call(input, new MapOutputHandler());

// Oracle
List&ltQueryParameters&gt outputList = (List&ltQueryParameters&gt) result.getCallInput().getValue("cursor");

// MySQL, MariaDB, PostgreSQL etc.
List&ltMap&ltString, Object&gt&gt outputList = result.getCallOutput();
</pre>

                                <div class="bs-docs-example">
                                    Example of XML input/output handler (handling custom class)
                                </div>
<pre class="prettyprint linenums">
String xmlContent = "&lt?xml version=\"1.0\"?&gt" +
    "&ltroot&gt" +
        "&ltquery id='org.midao.jdbc.examples.Student.findOne' outputHandler='BeanOutputHandler'&gt" +
            "SELECT name FROM students WHERE id = #{id,jdbcType=INTEGER,mode=in}" +
        "&lt/query&gt" +
    "&lt/root&gt";

// xml should be added to Repository before it can be executed
XmlRepositoryFactory.addAll(
    XmlRepositoryFactory.getDocument(new ByteArrayInputStream(
        xmlContent.getBytes()
    )
));

XmlInputOutputHandler&ltStudent&gt handler = new XmlInputOutputHandler&ltStudent&gt(Student.class, "findOne", 1);

// XML query execution
Student student = (Student) runner.execute(handler);
</pre>

                                <div class="bs-docs-example">
                                    Example of XML input/output handler (handling map)
                                </div>
<pre class="prettyprint linenums">
String xmlContent = "&lt?xml version=\"1.0\"?&gt" +
    "&ltroot&gt" +
        "&ltquery id='findStudent' outputHandler='MapOutputHandler'&gt" +
            "SELECT name FROM students WHERE id = #{id,jdbcType=INTEGER,mode=in}" +
        "&lt/query&gt" +
    "&lt/root&gt";

// xml should be added to Repository before it can be executed
XmlRepositoryFactory.addAll(
    XmlRepositoryFactory.getDocument(new ByteArrayInputStream(
        xmlContent.getBytes()
    )
));

XmlInputOutputHandler handler = new XmlInputOutputHandler("findStudent", 1);

// XML query execution
Student student = (Student) runner.execute(handler);
</pre>
                            </div>
                        </div>
                    </div>
                </div>

            </section>


            <!-- Next
            ================================================== -->
            <section id="what-next">
                <div class="page-header">
                    <h1>What next?</h1>
                </div>
                <p class="lead">Please review this website, browse JavaDocs, look at example Functional tests, browse forums and just take a peek at source code</p>

                <p class="lead">If you would like to ask question, submit an issue or propose an enhancement please go to <a target="_blank" href="https://github.com/pryzach/midao/issues">GitHub</a></p>

                <div class="accordion" id="mjdbc-next-accordion">

                    <div class="accordion-group">
                        <div class="accordion-heading accordion-heading-gray-c">
                            <a class="accordion-toggle text-center" data-toggle="collapse" data-parent="#mjdbc-next-accordion" href="#mjdbc-next">
                                <strong style="font-size:22px;line-height:35px;">Midao JDBC</strong>
                            </a>
                        </div>
                        <div id="mjdbc-next" class="accordion-body">
                            <div class="accordion-inner">
                                <a class="btn btn-large btn-primary" href="mjdbc/javadoc/index.html">Browse JavaDoc</a>
                                <a class="btn btn-large" href="https://github.com/pryzach/midao/tree/master/midao-jdbc-examples/src/main/java/org/midao/jdbc/examples" style="margin-left: 5px;">Examples</a>
                                <a class="btn btn-large" href="https://github.com/pryzach/midao" style="margin-left: 5px;">Look at sources</a>

                                <div class="btn-group pull-right">
                                    <a class="btn btn-large dropdown-toggle" data-toggle="dropdown" href="#">
                                        Ask questions / discuss
                                        <span class="caret"></span> </a>
                                    <ul class="dropdown-menu">
                                        <li>
                                            <a href="http://midao.org/vanilla" target="_blank">Midao forum</a>
                                        </li>
                                        <li>
                                            <a href="http://stackoverflow.com/" target="_blank">StackOverflow</a>
                                        </li>
                                        <li>
                                            <a href="http://www.coderanch.com/forums/f-3/JDBC" target="_blank">JavaRanch JDBC Forum</a>
                                        </li>
                                    </ul>
                                </div>
                                <!--
                                This section would be uncommented (if) as soon as Midao will have it's own branch/tag in one of the forums

                                <div class="btn-group pull-right">
                                    <a class="btn btn-large dropdown-toggle" data-toggle="dropdown" href="#">
                                        Visit forums
                                        <span class="caret"></span> </a>
                                    <ul class="dropdown-menu">
                                        <li><div class="text-center">No elements yet...</div></li>
                                    </ul>
                                </div>
                                -->

                            </div>
                        </div>
                    </div>

                </div>

                <hr class="bs-docs-separator">

            </section>


            <!-- Intense debate -->
            <section id="feedback">
                <div class="page-header">
                    <h1>Feedback</h1>
                </div>

                <p class="lead">Below you can provide feedback, suggestions, questions regarding information posted on current page</p>

                <script>
                    var idcomments_acct = '5ecab3490982db30c1c539bf485f65f2';
                    var idcomments_post_id;
                    var idcomments_post_url;
                </script>
                <span id="IDCommentsPostTitle" style="display:none"></span>
                <script type='text/javascript' src='http://www.intensedebate.com/js/genericCommentWrapperV2.js'></script>
            </section>

        </div>
    </div>

</div>


<!-- Footer
================================================== -->
<footer class="footer">
    <div class="container">
        <p>Designed and built based on Bootstrap</p>

        <p>Contact <a href="mailto:midao@midao.org">midao@midao.org</a> or <a target="_blank" href="http://twitter.com/midaoproject">@midaoproject</a></p>

        <ul class="footer-links">
            <li>
                <script src="http://platform.linkedin.com/in.js" type="text/javascript">
                    lang: en_US
                </script>
                <script type="IN/Share"></script>
            </li>
            <li class="muted">&middot;</li>
            <li>
                <a href="https://twitter.com/share" class="twitter-share-button" data-url="http://midao.org/home.html" data-text="Check Midao Project" data-via="midaoproject" data-count="none">Tweet</a>
                <script>!function (d, s, id) {
                    var js, fjs = d.getElementsByTagName(s)[0], p = /^http:/.test(d.location) ? 'http' : 'https';
                    if (!d.getElementById(id)) {
                        js = d.createElement(s);
                        js.id = id;
                        js.src = p + '://platform.twitter.com/widgets.js';
                        fjs.parentNode.insertBefore(js, fjs);
                    }
                }(document, 'script', 'twitter-wjs');</script>
            </li>
        </ul>

        <ul class="footer-links">
            <li><a target="_blank" href="https://github.com/pryzach/midao">GitHub</a></li>
            <li class="muted">&middot;</li>
            <li><a target="_blank" href="https://github.com/pryzach/midao/issues">Issues / Questions / Feature request</a></li>
            <li class="muted">&middot;</li>
            <li><a target="_blank" href="https://github.com/pryzach/midao/blob/master/CHANGELOG.md">Change log</a></li>
        </ul>
    </div>
</footer>


<!-- Le javascript
================================================== -->
<!-- Placed at the end of the document so the pages load faster -->
<script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script>
<script src="js/jquery.js"></script>
<script src="js/bootstrap-transition.js"></script>
<script src="js/bootstrap-alert.js"></script>
<script src="js/bootstrap-modal.js"></script>
<script src="js/bootstrap-dropdown.js"></script>
<script src="js/bootstrap-scrollspy.js"></script>
<script src="js/bootstrap-tab.js"></script>
<script src="js/bootstrap-tooltip.js"></script>
<script src="js/bootstrap-popover.js"></script>
<script src="js/bootstrap-button.js"></script>
<script src="js/bootstrap-collapse.js"></script>
<script src="js/bootstrap-carousel.js"></script>
<script src="js/bootstrap-typeahead.js"></script>
<script src="js/bootstrap-affix.js"></script>

<script src="js/holder/holder.js"></script>
<script src="js/google-code-prettify/prettify.js"></script>

<script src="js/application.js"></script>

</body>
</html>
